#!/usr/bin/env python
# -*- coding: utf-8 -*-

"""a test module
 test..."""
# 'a test module!'

__author__ = "wenke1"

import time


def formatedtime(timeintervalperhour, timeformat):
    """this is for ad time operation.
    The arguments:
        timeintervalperhour:时间间隔（单位小时）
        adtimeformat：自定义输出时间格式
    (e.g., setAdtime(72,'%Y-%m-%d')).
    """
    hourchgsec = 3600
    lt = time.localtime(time.time() + float(timeintervalperhour) * hourchgsec)
    print lt
    formated_time = time.strftime(timeformat, lt)
    return formated_time


if __name__ == '__main__':
    print formatedtime(72, '%Y-%m-%d')